import { createRouter, createWebHistory } from 'vue-router'
import order from "@/views/business/detail/order.vue";

const routes = [
  {
    path: '/',
    redirect:'business/list'
  },
    {
      path: '/business/list',
      component: () => import('@/views/business/list.vue')
},
  {
    path: '/business/detail',
    component: () => import('@/views/business/detail/index.vue'),
    redirect: 'detail/order',
    children:[
      {
        path: '/business/detail/order',
        component: () => import('@/views/business/detail/order.vue')
      },
      {
        path: '/business/detail/info',
        component: () => import('@/views/business/detail/info.vue')
      }
    ]

  },
  {
    path: '/cart/list',
    component: () => import('@/views/cart/list.vue')
  },

  {
    path: '/user/login',
    component: () => import('@/views/user/login.vue')
  },
  {
    path: '/user/newAdress',
    component: () => import('@/views/user/newAddress.vue')
  },
  {
    path: '/order/confirm',
    component: () => import('@/views/order/confirm.vue')
  }
]

const router = createRouter({
  history: createWebHistory(process.env.BASE_URL),
  routes
})

export default router
